<?php
/**
 * session 操作类
 * @copyright reginx.com
 * $Id: sess.extra.php 1473 2012-10-09 13:01:01Z lan7 $
 */
class sess_extra{

    /**
     * 构造函数
     *
     * @param unknown_type $conf
     * @return db_extra
     */
    private static function get($conf,$extra = array()){
        $conf['class'] = $conf['class'] ? $conf['class'] : 'default';
        $file = REGINX_PATH . 'extra/sess/' . $conf['class'] . '.sess.php';
        !is_file($file) && core::error(core::L('no-sess-driver' , $conf['class']));
        include_once($file);
        $class = $conf['class'] . '_sess';
        return new $class($conf[$conf['class']] , $extra);
    }

    /**
     * 获取数据库操作对象
     *
     * @param unknown_type $conf
     * @return unknown
     */
    public static function &getobj($conf,$extra = true){
        static $sobj = null;
        if(empty($sobj)){
            $sobj = self::get($conf , $extra);
        }
        return $sobj;
    }
}
?>